home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programmierung
/
Power-Programmierung (Tewi)(1994).iso
/
magazine
/
dbms_mag
/
9107
/
diet110a.exe
/
DIET110A.DOC
< prev
Wrap
Text File
|
1991-04-29
|
28KB
|
695 lines
************************************************************
An effective use of DIET version 1.10a
------ by Teddy Matsumoto ---------
************************************************************
1. Let's try DIET!
A new revolution in file compression technology is made by TSR mode.
DIET.EXE is a file compression utility as well as a file utility to
use compressed files. Diet can compress executable files and can
execute them as LZEXE or PKLITE. WHAT is REALLY NEW in this program
is to compress DATA files, too.
Yes, we do have to decompress the data file to use them if they
are in compressed form. And that's what actually happens.
If you let DIET stay as a TSR program, then you don't have to
care about whether data files are compressed or not. Let us try some
examples' first.
2. The simplest and the most effective use of DIET.
A rough classification of files of DOS may be in two categories,
namely executables and data files. The former activates the later
in general.
The number of files on your disk of the later category is greater
in most of the cases than the former.
DIET can compress both categories of files, but these two categories
behave differently. Executable files are compressed with some self
-extracting header and decompressed on the memory to the original
format. Naturally there are executable files with overlays or files
which overwrite itself. Data files on the other hand, have to be
restored to the original form when they are referred from the
executable files. The process is carried out manually or by batch
mode ordinarily.
The revolutionary idea of DIET is that the program takes care of
expansion and compression automatically while you are not conscious
of what's really going on! If you are reading this file with DOS
command MORE.COM then stop it. And try:
Diet MORE.COM -------MORE.COM is compressed.
Diet diet110a.doc ----this document will be compressed.
Diet -z -p ----------let diet stay on memory.
If you have EMM.SYS, then you
will see diet uses 1 page of EMS.
more < diet110a.doc -- to read the compressed file with
compressed COM file, a pager.
How do you like it? Don't forget to type finally,
"diet -zr"
to let TSR part detached from your memory. If you're a man of
curiosity, try CHKDSK twice, when DIET is on the memory and off
the memory to know the size of TSR part of DIET.
When DIET is stay resident on your memory, you can do your normal
work as if none of your file is compressed by DIET. There were many
files with overlays which could not be compressed by LZEXE, PKLITE
or by earlier version of DIET. The TSR mode DIET will handle these
files easily without letting you be conscious of them being in
compressed form.
TSR mode of DIET has a very strong power and control over the
programs. However, if you are anxious of any kind for the TSR mode,
please start using DIET with non-TSR mode, until you could get a
full understanding of its principle of actions in non-TSR mode.
Diet is worth using even in nonresident mode only.
Use of DIET, non-TSR mode.
~~~~~~~~~~~~~~~~~~~~~~~~~~
Type DIET to see all the command and options available.
There are very few commands you have to remember in the non-TSR mode
-l,-r and -ra
are the all you need to know now.
Let us now compress an application software. As an example we take
QH.EXE and RM.EXE, accompanying file for MSC ver 6.00. If you do not
know the programs, you do not need to know what they are.
RM EXE 33337 2-20-90 5:22a
Let us first type 'rm -h' to see the help-screen of RM.EXE.
--------------------------------------------------------
Microsoft File Removal Utility. Version 1.01
Copyright (C) Microsoft Corp 1987-90. All rights reserved.
Usage: RM [/help] [/ikf] [/r dir] files
............................
'rm' terminated abnormally. Exit status = 1
Real time in seconds: 0.330
---------------------------------------------------------------
The last line is just an approximate time measured to see the
help screen. Now you compress RM.EXE with DIET by 'diet rm.exe'.
---------------------------------------------------------------
<<<< exciting file slimming exerciser 'DIET' version 1.10a >>>>
.... copyright(c) 1991,4/1 by Teddy Matsumoto ....
Compress 'RM.EXE' .........
Success! (33337 to 22192 bytes)
--------------------------------------------------------------
The file is compressed to about 2/3 of the original. You may
execute RM.EXE from this compressed file.
--------------------------------------------------------------
'rm' terminated abnormally. Exit status = 1
Real time in seconds: 0.490
--------------------------------------------------------------
That is, you just need a fraction of a second to expand the file
to the original size and execute; 0.490-0330=0.16 seconds.
When you deal with a file with larger size, the you gain more space
to store the file, but you need more time to expand.
Compress 'QH.EXE' ...............................
Success! (120005 to 76976 bytes)
This is a significant gain in size, but you will certainly feel
some delay in time before you see the screen.
There are similar utilities PKLITE and LZEXE with this executable
file compression utility. DIET differs from other utilities in
its capability to compress data files. However, you must know
DIET in its TSR mode in automatic compression and decompression
of data files. In the following examples, MICROSOFT WORKS is used
to illustrate the functions of DIET.
Files with Overlays.
^^^^^^^^^^^^^^^^^^^
Now let us move to the directory c:\works where you are supposed to
setup the Microsoft Works. Let us try to compress the main executable
WORKS.EXE with DIET.EXE. The following message will appear.
------------------------------------------------------------
<<<< exciting file slimming exerciser 'DIET' version 1.10a >>>>
.... copyright(c) 1991,4/1 by Teddy Matsumoto ....
Compress 'WORKS.EXE' - file size mismatch! (may be overlay file)
Use -V or -I option to continue to process.
to compress EXE file together with overlay or help files by
wild card specification:
diet -v works.*
------------------------------------------------------------
<<<< exciting file slimming exerciser 'DIET' version 1.10a >>>>
.... copyright(c) 1991,4/1 by Teddy Matsumoto ....
Compress 'WORKS.EXE' (overlay mode) ...........................
...............................................................
Success! (382430 to 294903 bytes)
Compress 'WORKS.OVL' ..........................
Success! (100922 to 83327 bytes)
Compress 'WORKS.HLP' .................................
Success! (132552 to 77430 bytes)
------------------------------------------------------------
Small Files with -b Option.
^^^^^^^^^^^^^^^^^^^^^^^^^^^
There are other files you can't compress. WORKS.PIF and
WORKS.INI. To compress these files, try 'diet -b works.*'.
Note, that DIET accepts wild cards and multiple file names
on a command line like ' diet -b works.ini works.pif'.
<<<< exciting file slimming exerciser 'DIET' version 1.10a >>>>
.... copyright(c) 1991,4/1 by Teddy Matsumoto ....
Compress 'WORKS.INI' .
Success! (52 to 47 bytes)
Compress 'WORKS.PIF' .
Success! (369 to 108 bytes)
L option To list DIETed files.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
To see files compressed by DIET you type 'diet -l' to see:
------------------------------------------------------------------
<<<< exciting file slimming exerciser 'DIET' version 1.10a >>>>
.... copyright(c) 1991,4/1 by Teddy Matsumoto ....
------ listing of DIET files matched with '*.*' ------
WORKS.EXE WORKS.HLP WORKS.OVL WORKS.INI WORKS.PIF
------------------------------------------------------------------
Files DIET fail to compress.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Try 'diet THESAR.LEX'.
------------------------------------------------------------
Compress 'THESAUR.LEX' ........................................
...............................................
Compressing failed! (329707 to 348707 bytes)
------------------------------------------------------------
The file itself seems to be compressed by some other method already.
Generally, diet will fail to compress files with extensions:
.ARC, .ARJ, .LZH, .PAK, .ZIP
These are compressed in themselves and cannot be compressed any more.
This does not mean that ARC, ARJ, LHA, PAK or PKZIP cannot compress
files compressed by DIET.
DIET will not compress executable files already compressed by similar
utilities as PKLITE or LZEXE.
There are certain exceptional TSR programs which will conflict with
DIET.EXE. The files compressed by earlier versions of DIET.EXE bear
no marks that they are compressed and will be further compressed by
this new version, but the file will fail to execute. This version
will be compatible with the versions 1.01a up on.
If you type 'works', then you will see messages :
------------------------------------------------------------------
DIET file!
DIET file!
'works' terminated abnormally. Exit status = 36
Real time in seconds: 0.170
------------------------------------------------------------------
and you see the program abort. This is because WORKS.EXE cannot
load its overlay module WORKS.OVL. Proceed to read DIET in TSR mode.
DIET in TSR mode.
================
To let DIET stay on the memory, you use -Z option:
diet -Z
You will see a message "diet stayed on the memory", and if you
have EMM.SYS in your config.sys file, you will see, also,
"EMS page 1 used by diet". That is, DIET's resident part resides
mainly in EMS except for only a small part of the program.
You start with the following DIETed files.
------ listing of DIET files matched with '*.*' ------
WORKS.INI WORKS.EXE WORKS.OVL WORKS.PIF WORKS.HLP
Now WORKS wakes up if you type 'works', you will see the screen
slower perhaps 10 or more seconds than usual. Then just quit from
WORKS and check the list of DIETed files. You will notice
WORKS.INI is no longer compressed, and its size in the original
size before compression.
------ listing of DIET files matched with '*.*' ------
WORKS.EXE WORKS.OVL WORKS.PIF WORKS.HLP
Now you see resident part of DIET hooks necessary files to
activate the program WORKS. It keeps the files opened in
Read mode in their original sizes and expand the files opened
in their original sizes, so that DIET can transact these files.
You can edit or compute files opened from Works from their
compressed state and expand and rewrite them in uncompressed
form. You could keep them compressed by typing 'diet *.*'if
you wish. However, here is a better idea!
Auto recompress mode.
^^^^^^^^^^^^^^^^^^^^^
This mode is supported from this version on. You can edit or
modify compressed files automatically opened up and save them
as they are in COMPRESSED form.
First prepare 'CONFIG.SYS and AUTOEXEC.BAT files NOT
compressed by DIET.EXE. You may compress COMMAND.COM if you
wish. The system will boot with compressed COMMAND.COM.
Prepare EMM.SYS or any other equivalent for
device=emm.sys
or by hardware setup program in CONFIG.SYS so that the resident
part of DIET.EXE will reside in Expanded Memory. Next insert a
line in AUTOEXEC.BAT file '\bin\diet -z -p', meaning DIET.EXE
being resident in memory, being prepared to compress files once
opened in read-write mode. Another line set TMP=e:\, where the
drive 'E:' is supposed to be a high speed memory device such as
a ramdisk or a hardram.
When you boot up your system, then you will see a message:
------------------------------------------------------------
<<<< exciting file slimming exerciser 'DIET' version 1.10a >>>>
.... copyright(c) 1991,4/1 by Teddy Matsumoto ....
Stayed on memory! (use EMS 1 page)
auto recompress : on (with messages)
temp. directory : E:\
------------------------------------------------------------
You may edit file readme.wps. Works.exe contains a word-processor
as a part of its function and suppose you finished editing and
saved the file. If you are really working with WORKS.EXE, you must
quit from this software.
When you quit, watch carefully the screen to capture the message
Compress README.WPS......
Success ! (27334 to 19345 bytes)
Yes, that's the DIET in action, DIET expanded the compressed
file readme.wps and edited in the expanded form, saved as it is.
Then when the process terminates, DIET is hooked up and compressed
the file opened for read and write.
3.Basic Functions of DIET.
==========================
There are 4 basic functions of DIET.exe,i.e.
to COMPRESS files:
to DECOMPRESS compressed files: -r -ra -v -i -b options;
to make DIET terminate and stay resident: -z,-za,-zd -zr -p
options
and
to list files or to test for compressed: -l -c -m options.
Usage: DIET [options] [file_names].
Options: -r,-ra,-v,-i,-p,-z,-za,-zd,-zr,-o,-t,-i,-m, -b or -a.
You may use '-' of '/' as the switch-character as you prefer.
If you do not specify option, then the function is to compress.
Or if you don't specify any option nor file name, then diet
will display the help screen.
File_Names: You can't omit file name input except for -l option.
You can use WILDCARDS and MULTIPLE filenames on the command line.
File Compression: If none of the options -l,-r,-ra,-z,-za,-zd and -c
is specified, Diet compresses specified file(s), except when
the given file is already compressed by DIET or the extension
is LZH. Different headers will be attached to compressed files
according to the extensions COM, EXE or ELSE respectively.
IMPORTANT NOTE. DIET will overwrite on the original files except
with -o option. The storage space save DIET makes no backups in
principle. If you are not sure of the result, please take a
backup of the file(s). You will be assured of the safety
precautions designed in this software after using it for some
period of practice. However we strongly recommend to take
backup of files when you use with other TSR programs and when
your available memory is not large enough.
The dynamic Lempel-Ziv method adopted in the software may fail
to compress files compressed with other tools. The success or
failure in compression is determined by the number of clusters
a file needs for its storage.
File Decompression: With -r or -ra option, DIET decompresses files
it had compressed. With '-r' option files with extensions
EXE and COM remain compressed and other files are restored.
Namely, this is to restore all the data files to the original.
With '-ra' option, you could restore all.
TSR On/Off option. '-z' ,'-zr'.
DIET -z
will announce either "stayed on memory' and "removed from memory".
When you compressed COMMAND.COM or when you compressed some
overlay files, you need DIET to be resident on, memory.
I recommend you to write a line "diet -z" in your autoexec.bat
file, if you are an expert DIETER.
You may change the size of resident part of DIET by specifying
positive integers from 1 to 9 after '-z' like:
DIET -z8 (default value is 2).
If you increase the number, the resident part grows in size with
faster compress-decompress actions. DIET uses 1 page from EMS
(Lotus-Microsoft ) if it finds one. The size of the resident
part is reduced by the EMM.sys utility.
IMPORTANT NOTE. This is not only for DIET, but if you use multiple
TSR programs, be careful to unload according to the
reverse order they were loaded into the mammary.
Temporary Enable/Disable TSR part of DIET.
DIET -zd disables resident part of DIET without unloading.
DIET -za enables resident part of DIET without reloading.
The second command restores the resident DIET when an
interrupt was received from keyboard or from any other device's.
Remember this switch, when you pressed Ctrl-C or Ctrl-Break
while DIET had been acting.
LIST files compressed with DIET.
DIET -L
will list files compressed with DIET. You may skip wild card
for the option.
Check Files Compressed by DIET.
DIET -C <file_name >.
Check the file if it is compressed by diet, and checks CRC for
the integrity.
Backup Files, Output Directories.
By default, DIET overwrites files by compressed equivalent with
the same name. So if you want to back up the files before you
apply DIET by '-o' option.
<Example 1>. You are not on DRIVE A: and you want the compressed
file of alpha.dat on A: with the same name on your current
directory:
DIET -O A:alpha.dat.
<Example 2>. Compress the file alpha.dat on the current directory
compressed, and record it on the directory C:\TEMP:
DIET -OC:\temp\ alpha.dat
^ ^
Please note the positions of the spaces and back slashes.
<Example 3>. beta.dat has been compressed by DIET on the current
directory. Decompress this file and record it on the root
directory with the name alpha.dat:
DIET -R -O\alpha.dat beta.dat
Specify Directory for temporary files:
By default, DIET makes temporary files on the current directory.
It is recommended to specify the directory on which temporary
files to be made with the TSR mode. DIET makes temporary files
very frequently in TSR mode, consequently, if DIET could use
High Speed Memory Devices, DIET runs smooth and easy.
In case of nonresident mode, DIET compresses and decompresses on
memory, in principle, so you need not use this option.
DIET -Z -TD:\temp\ , where d: is supposed to be a RAMDISK.
DO NOT FORGET THE LAST "\" in this option.
~~~
Ignore Warning Messages:DIET -I [file_names].
DIET ordinarily stops compression for the files with overlays
when the size of the file in EXEHDR information is not the
same, with the message 'may be overlay files'. Since DIET can
take care of overlay files in the TSR mode, DIET may ignore
warnings and continue compression with '-I' option.
Those who use DIET only in nonresident mode should refrain
from using this option. There are EXE files which are loaded
in high memory. DIET warns you with the same message as
overlays, but you can't expect to have a smooth action with
such executables.
Overlay mode option -V.
DIET compress executables as self-extracting compressed file
in general, but with this option on, DIET uses overly type
compressions. A self-extracting file can be executed by itself
if and only if the entire file is expanded in the memory. Files
compressed in Overlay Mode is executed only when the resident part
of DIET is active. However, Files compressed in overlay mode
are expanded as temporary overlay modules loadable as requested.
You can compress large files which can not be fit in the memory
in overlay modules. In general files compressed in overlay mode
need no self-extractig header, consequently they are smaller than
the files in self-extracting mode.
Auto recompress DIET -p [options] [file_names]
This switch is a toggle. You need resident part of DIET to
be active with this option. Auto recompress is disabled in
DIET defaults, so you must always enable this switch.
DIET -p will disable the switch.
Japanese Messages Outputs: DIET -J [options] [file_names].
I am sorry that some witty succinct Japanese messages are
not imbedded in English messages. However, if you have
JDOS4.0 from IBM Japan, you may listen to the advice of
DR.Matsumoto on the present shape of your disk health status.
No message:DIET -M [options] [file_names].
If your screen is mixed up with the messages from
DIET activated as a child process from your editor etc.,
use this switch to make DIET silent.
Read Only Attribute: DIET -A [options] [file_names].
This is only for the sake of safety. This will make all
the data files to have attribute read-only. If you are using
DIET in resident mode, your editors invoke diet to decompress
a compressed file, if not your data files are not compressed.
In case your editor opened a compressed file, when you don't
have DIET resident, your editor may not be able to quit from
editing compressed binary file. A rare possibility, it might be.
This switch makes all the compressed file to be read-only.
You can not edit a file without changing its attribute.
Please note, if you copy a file from the original position,
then its file size will normally be restored to its original
size.
4. Environmental Variables.
~~~~~~~~~~~~~~~~~~~~~~~~~~~
DIET from version 1.02x refers to the following environmental strings.
DIETOFF File_names for which DIET is disabled to act in resident mode.
DIETSIZE File_names which returns the real size of compressed
files when referenced.
DIETOPT set options you use as your defalut. Valid only for the options
-b -v -j -i -a .
** NOTE reference to environmental string is possible only in MS-DOS
ver3.xx or after.
[ DIETOFF ] DIET in its resident mode has a powerful control over
files. In return, we have to be careful for its subsidiary actions.
For an example, when you copy compressed files:
COPY diet102b.doc diet110a.doc
you will know diet110a.doc has the original uncompressed file size.
Of course you can type:
DIET -ZD
COPY DIET102b.DOC DIET110A.DOC
to produce an exact copy of compressed size, yet it is better to
SET DIETOFF=COMMAND.COM;FC.COM;XCOPY.EXE
to the effect typing, dumping and copying without reproducing
files to original sizes.
Register names of program to DIETOFF to disable reproduction
of the uncompressed files. You don't have to specify full path
names. DIET just ignores them and is concerned with program
names only.
[ DIETSIZE ] There are programs which read in data files only to the
size obtained by the Function Call AH=4Eh/4F/h. In earlier versions
of DIET, it fails to read the data properly for such programs.
This string refers to such programs.
SET DIETSIZE=**.COM;***.EXE
will enable **.COM and ***.EXE to read compressed MSG or HLP
files, and will disable them to return "Wrong file" messages.
Unfortunately, there are many files including SK.COM, which
checks data files with other methods for different versions.
[ DIETOPT ] You can set options you use as default:
<Example.> set DIETOP=-b -v.
5. Other Comments.
~~~~~~~~~~~~~~~~~
File Open Error message.
When DIET is in its resident mode, you may see a message
"Can't find abc.exe" even if the file exists. DIET usually
decompresses files on the directory specified by -T option,
and if it fails to find enough room to decompress, DIET
says that it could not open the file. However, there are
programs which say "cannot find ...." when it fails to open
a file.
Temporary File Names.
Using DIET in resident mode, you will often see files with
names such as __DIET__.*. You will get these files when you
reset system or stop execution by Ctrl-Break. These are the
temporary files generated by DIET. You may or may not erase
those files, since they are under constant transactions.
Warning !
~~~~~~~~
The version has been well tested by many 'brave' people
who were not afraid of uncountable backups, collisions with other
TSR's or RESETings. However, we are not sure, yet, of unexpected
bad timings with other resident programs or devices. Please be
warned against the use of this software with other resident programs
especially in its resident mode. The author can not be liable for
the damages caused by the use of this program. Backup your files
before testing every time you use with a new program.
Our Distribution Policy.
~~~~~~~~~~~~~~~~~~~~~~~~~
The program together with the other packaged documents is
copyrighted by Teddy Matsumoto.
You may copy, distribute and use this program free of charge
under the conditions:
you may not charge for copying or distributions,
you use this for your personal purposes,
you are to follow up versions if you port, and
you must copy or distribute the entire package.
Acknowledgements
~~~~~~~~~~~~~~~~
To Haruyasu Yoshizaki who found the vital bug which I could not find
up to the last moment,
to K.Okubo who introduced this software outside of Japan,
and to my friends in Fgal/Flabo forums on Nifty Serve who
dared to hang on the earlier versions in spite of the hang overs
from so many Hang Up's.
How to contact the Author.
~~~~~~~~~~~~~~~~~~~~~~~~~~
Email to Teddy Matsumoto at GBG00230 on Nifty Serve.
Users not resident in Japan may contact K.Okubo at
74100,2565 Compuserve , K.Okubo Genie, or c00236@sinet.ad.jp
Revision History.
version 1.00x Beta test versions.
version 1.01a (2/01/91) First TSR version.
version 1.01b (2/16/91) To detect EMS, routine checked the
possible opening of files name "EMMXXXX0"
in some cases incomplete.
Some routines failed to act normally for
DISK I/O by INT21h.
version 1.02a (2/24/91) Changed method to detect charater devices.
Use EMS to reduce the resident part of
DIET.
New environmental variable DIETOFF by which
programs disabled in TSR mode.
Returns decompressed file size when a program
in DIETSIZE acknowledge interrupt AH=4Eh/4Fh.
version 1.02b (3/04/91) If COMMAND.COM is set to DIETOFF,COMSPEC need
not be present at the top of enviroment area.
Bug for the -T option, temporary file not
always generated on TMP directory, fixed.
version 1.10a (4/01/91) Automated recompression supported -p option.
From -z toggle to new -zr option.
Byte count option -b added.
TSR part now refers TMP and DIETOPT.
DIET beeps when it fails decompression.
Overlay mode and -v option newly designed.
Support function call AH=4B03.
Safely compress large files of approximately
up to 1MB.
A bug fixed with -o option where DIET failed
to compress EXE files.
==================End of Diet110a.doc=============================